﻿using FoodModel;
using J.FoodManageGet.Application.Command.TableNumCommand;
using J.FoodRepository.InterFace;
using MediatR;

namespace J.FoodManageGet.Application.CommandHandler.TableNumCommand
{
    /// <summary>
    /// 桌号反填
    /// </summary>
    public class TableNumBackCommandHandler : IRequestHandler<TableNumBackCommand, TableNumModel>
    {
        private readonly ITableNumRepository _tableNumRepository;

        public TableNumBackCommandHandler(ITableNumRepository tableNumRepository)
        {
            _tableNumRepository = tableNumRepository;
        }
        public async Task<TableNumModel> Handle(TableNumBackCommand request, CancellationToken cancellationToken)
        {
            var list = await _tableNumRepository.NumBack(request.TableNumId);
            return list;
        }
    }
}
